import 'package:flustars_flutter3/flustars_flutter3.dart';
import 'package:ls_work/common/common.dart';
import 'package:ls_work/net/net.dart';
// import 'package:flutter_marketing/util/toast.dart';
import 'package:install_apk_plugin/install_apk_plugin.dart' as i;
import 'package:ls_work/util/toast.dart';

class InstallApkPlugin {
  /// 应用安装
  static void install(String path) {
    // print('🍎' + path);
    if (TextUtil.isEmpty(path)) {
      Toast.show('文件损坏，请联系开发人员');
      return;
    }
    // String appId = HttpApi.baseUrl.contains('cqtyanglao')
    //     ? 'com.landsea.ls_work'
    //     : 'com.landsea.ls_worktest';
    String? appId = SpUtil.getString(Constant.applicationId);
    if (TextUtil.isEmpty(appId)) {
      Toast.show('applicationId不一致，请联系开发人员');
      return;
    }
    i.InstallApkPlugin.installApk(path);

  }

  /// AppStore跳转
  static void jumpToAppStore() {
    // String url =
    //     'https://apps.apple.com/cn/app/%E5%B8%B8%E9%9D%92%E8%97%A4%E8%90%A5%E9%94%80/id1493477143';
    // InstallPlugin.gotoAppStore(url);
  }
}
